From: kaf24@firebug.cl.cam.ac.uk Date: Thu, 25 May 2006 13:42:07 +0000 (+0100) Subject: Fix xc_tbuf.c indentation and stop turning failure to change X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16025^2~18 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=22c42d4bc02243c6cf592c0957238d571148417f;p=xen.git Fix xc_tbuf.c indentation and stop turning failure to change trace-buffer size into a fatal error. Signed-off-by: Keir Fraser --- diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c index 699ebd355e..3160da1942 100644 --- a/tools/libxc/xc_tbuf.c +++ b/tools/libxc/xc_tbuf.c @@ -18,53 +18,57 @@ static int tbuf_enable(int xc_handle, int enable) { - DECLARE_DOM0_OP; + DECLARE_DOM0_OP; - op.cmd = DOM0_TBUFCONTROL; - op.interface_version = DOM0_INTERFACE_VERSION; - if (enable) - op.u.tbufcontrol.op = DOM0_TBUF_ENABLE; - else - op.u.tbufcontrol.op = DOM0_TBUF_DISABLE; + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + if (enable) + op.u.tbufcontrol.op = DOM0_TBUF_ENABLE; + else + op.u.tbufcontrol.op = DOM0_TBUF_DISABLE; - return xc_dom0_op(xc_handle, &op); + return xc_dom0_op(xc_handle, &op); } int xc_tbuf_set_size(int xc_handle, unsigned long size) { - DECLARE_DOM0_OP; + DECLARE_DOM0_OP; - op.cmd = DOM0_TBUFCONTROL; - op.interface_version = DOM0_INTERFACE_VERSION; - op.u.tbufcontrol.op = DOM0_TBUF_SET_SIZE; - op.u.tbufcontrol.size = size; + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + op.u.tbufcontrol.op = DOM0_TBUF_SET_SIZE; + op.u.tbufcontrol.size = size; - return xc_dom0_op(xc_handle, &op); + return xc_dom0_op(xc_handle, &op); } int xc_tbuf_get_size(int xc_handle, unsigned long *size) { - int rc; - DECLARE_DOM0_OP; + int rc; + DECLARE_DOM0_OP; - op.cmd = DOM0_TBUFCONTROL; - op.interface_version = DOM0_INTERFACE_VERSION; - op.u.tbufcontrol.op = DOM0_TBUF_GET_INFO; + op.cmd = DOM0_TBUFCONTROL; + op.interface_version = DOM0_INTERFACE_VERSION; + op.u.tbufcontrol.op = DOM0_TBUF_GET_INFO; - rc = xc_dom0_op(xc_handle, &op); - if (rc == 0) - *size = op.u.tbufcontrol.size; - return rc; + rc = xc_dom0_op(xc_handle, &op); + if (rc == 0) + *size = op.u.tbufcontrol.size; + return rc; } int xc_tbuf_enable(int xc_handle, size_t cnt, unsigned long *mfn, - unsigned long *size) + unsigned long *size) { DECLARE_DOM0_OP; int rc; - if ( xc_tbuf_set_size(xc_handle, cnt) != 0 ) - return -1; + /* + * Ignore errors (at least for now) as we get an error if size is already + * set (since trace buffers cannot be reallocated). If we really have no + * buffers at all then tbuf_enable() will fail, so this is safe. + */ + (void)xc_tbuf_set_size(xc_handle, cnt); if ( tbuf_enable(xc_handle, 1) != 0 ) return -1;